<!DOCTYPE html>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"sophimp.gitee.io","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="公司有短信pdu相关业务, 借此机会分析了一波，短信与电话模块的代码，实话讲没分析出个啥，可参考意义不大， 后续有机会再整理分析, 又是一个坑。。。">
<meta property="og:type" content="article">
<meta property="og:title" content="Android短信与电话模块分析">
<meta property="og:url" content="http://sophimp.gitee.io/2019/11/28/android/advanced/phone_message_architecture_analysis/index.html">
<meta property="og:site_name" content="Sophimp&#39;s Space">
<meta property="og:description" content="公司有短信pdu相关业务, 借此机会分析了一波，短信与电话模块的代码，实话讲没分析出个啥，可参考意义不大， 后续有机会再整理分析, 又是一个坑。。。">
<meta property="article:published_time" content="2019-11-28T09:51:46.000Z">
<meta property="article:modified_time" content="2021-03-15T03:49:47.918Z">
<meta property="article:author" content="Sophimp">
<meta property="article:tag" content="Android">
<meta property="article:tag" content="短信与电话">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://sophimp.gitee.io/2019/11/28/android/advanced/phone_message_architecture_analysis/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-Hans'
  };
</script>

  <title>Android短信与电话模块分析 | Sophimp's Space</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

	
	<script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
	

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Sophimp's Space</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">coding & thinking</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/sophimp" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
    <link itemprop="mainEntityOfPage" href="http://sophimp.gitee.io/2019/11/28/android/advanced/phone_message_architecture_analysis/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Sophimp">
      <meta itemprop="description" content="A dream begin">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sophimp's Space">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Android短信与电话模块分析
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2019-11-28 17:51:46" itemprop="dateCreated datePublished" datetime="2019-11-28T17:51:46+08:00">2019-11-28</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2021-03-15 11:49:47" itemprop="dateModified" datetime="2021-03-15T11:49:47+08:00">2021-03-15</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B7%A5%E5%85%B7/" itemprop="url" rel="index"><span itemprop="name">工具</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">Views: </span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <div class="post-description">公司有短信pdu相关业务, 借此机会分析了一波，短信与电话模块的代码，实话讲没分析出个啥，可参考意义不大， 后续有机会再整理分析, 又是一个坑。。。</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="android-短信与电话模块分析"><a href="#android-短信与电话模块分析" class="headerlink" title="android 短信与电话模块分析"></a>android 短信与电话模块分析</h2><p>目的: </p>
<pre><code>1. 何为AT指令?
2. 分析源码, 确认at指令的发送以及返回信息的内容, 是否可以抛到上层, 
3. 当前的开关机检测机制是否准确? 
4. 在适配rom的时候, 这方面涉及的到配置有哪些? rc文件, so库, system.prop</code></pre><h3 id="at指令"><a href="#at指令" class="headerlink" title="at指令"></a>at指令</h3><p>AT指令是一种 Command language, 也叫作 Hayes command set, 是 Dennis Hayes 在1981年为其发明的300波特率的调制解调器发明的语言. 这一命令集由一系列的短文本字符串组成, 这些指令可以联合起来产生拨打电话, 挂断电话, 改成连结参数等一系列操作指令. 更说细的内容请参考附录[2][3]. </p>
<p>sms 和 mms 相关介绍参考附录[1]</p>
<p>每一条at指令需要回车符作为确认, 否则设备不认可</p>
<p>发送短信</p>
<pre><code>1. AT+CMGF=1 回车                // 设置短信发送格式, 1 代表文本格式, 0 代表pdu格式
2. AT+CMCA=&quot;+86138******&quot; 回车    // 设置电话号码, 一般模块都会默认设置
3. AT+CMCS=&quot;+86 手机号码&quot; 回车 // 设备会返回一个 &quot;&gt;&quot;
4. 输入需要发送的字符串, ctrl+Z 结束发送. </code></pre><p>命令行示例:</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">AT+CMGF=1</span><br><span class="line">OK</span><br><span class="line">AT+CMGS=<span class="string">"+31628870634"</span></span><br><span class="line">&gt; This is the text message.→</span><br><span class="line">+CMGS: 198</span><br><span class="line">OK</span><br></pre></td></tr></table></figure>

<p>读取短信</p>
<pre><code>1. AT+CMGR=X 回车        // X代表sim卡中第几条短信, 一般sim卡是30-50不等 
2. 串口会返回一长字符串 // 一般是由短信标志, 来电号码, 短信内容, 发送, 时间等等几部分组成. 
3. AT+CMGD=x 回车        // 当sim卡满时, 是不可以收到短信的, 当设备收到短信时, 串口会返回一串字符</code></pre><p>命令行示例:</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">AT+CMGF=1</span><br><span class="line">OK</span><br><span class="line">AT+CMGL=<span class="string">"ALL"</span></span><br><span class="line">+CMGL: 1,<span class="string">"REC UNREAD"</span>,<span class="string">"+31628870634"</span>,,<span class="string">"11/01/09,10:26:26+04"</span></span><br><span class="line">This is text message 1</span><br><span class="line">+CMGL: 2,<span class="string">"REC UNREAD"</span>,<span class="string">"+31628870634"</span>,,<span class="string">"11/01/09,10:26:49+04"</span></span><br><span class="line">This is text message 2</span><br><span class="line">OK</span><br><span class="line">AT+CMGD=1</span><br><span class="line">OK</span><br><span class="line">AT+CMGD=2</span><br><span class="line">OK</span><br></pre></td></tr></table></figure>
<p>以上参考附录[6]</p>
<p>更详细的at指令互动参考附录[7], 以及附件pdf(sending_sms_at_commands.pdf)</p>
<p>更详细的at命令列表(完整的at列表请参看附录[8]及附件pdf(supported_at_command_reference)):</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">AT – Check to see <span class="keyword">if</span> the module is active. Should <span class="built_in">return</span> ‘OK’</span><br><span class="line">AT+CREG? – Is the module registered to the network? Set the mode first: AT+CREG=2</span><br><span class="line">AT+COPS? – What network is the module registered?</span><br><span class="line">AT+CMGF=1 – This puts the module into text mode so messages can be sent/received</span><br><span class="line">AT+CMGS=”number”,129 &lt;cr&gt;&lt; body of message&gt; &lt;1A&gt; – Send a text message.</span><br><span class="line">AT+CMGL=”ALL” – Lists all text messages that are on the device (or network)</span><br><span class="line">AT+CMGR=&lt;index&gt; – Read SMS message at index number</span><br><span class="line">AT+QBAND? – What band am I on?</span><br><span class="line">AT+CIMI – Get the IMSI number from the module</span><br><span class="line">AT+CSQ – Check the signal strength</span><br><span class="line">AT+GSN – Get IMEI number</span><br><span class="line">AT+QSPN – Get service provider name</span><br><span class="line">AT+QCCID – Get CCID number from SIM</span><br><span class="line">AT+CRSM – SIM card restricted access (still researching)</span><br><span class="line">AT+CSIM – Generic SIM access (still researching)</span><br></pre></td></tr></table></figure>

<p>通过以上的资料可知, 由调制解调器封装后返回信息并不是很多, 信息发送成功也只是返回OK, 发送失败, 是通过等待一定的时间来判断的. 那么接下来分析,源码是否可以获取得多的信息, 判断当前的开关机检测是否准确. </p>
<p>使用pdu 发送短信参考附件[9]</p>
<h3 id="源码分析"><a href="#源码分析" class="headerlink" title="源码分析"></a>源码分析</h3><p>com.android.internal.telephony.SMSDispatcher.java  调用接口sendText(…) 具体实现在下面两个类<br>    com.android.internal.telephony.gsm.GsmSMSDispatcher.java  进一步跟踪,调用链为 sendText() -&gt; sendSms() -&gt; sendSmsByPstn()<br>    com.android.internal.telephony.cdma.CdmaSMSDispather.java 同上</p>
<p>由上一步的GsmSMSDispatcher/CdmaSMSDispatcher 中的mCi.sendImsGsmIms 调用到 com.android.internal.telephony.RIL.java 中的 sendImsGsmSms()</p>
<p>最终是通过AIDL, 访问android.hardware.radio.V1_1.IRadio, 再通过hidl方问硬件so库, 具体调用链如下:<br>com.android.internal.telephony.RIL.java::sendImsGsmSms() -&gt;<br>    android.hardware.radio.V1_1.IRadio.java::sendImsSms() -&gt;<br>        android.os.HwParcel -&gt; android.os.IHwBinder::transact(104/<em>sendImsSms</em>/, _hidl_request, _hidl_reply, android.os.IHwBinder.FLAG_ONEWAY);<br>    com.android.internal.telephony.metrics.TelephonyMetrics.java::writeRilSendSms() /* 添加回调 */<br>    com.android.internal.telephony.metrics.InProgressSmsSession.java -&gt;<br>    com.android.internal.telephony.nano.TelephonyProto.SmsSession.Event</p>
<p>解析串口数据, 通过 com.android.internal.telephony.nano.TelephonyProto::writeTo() 回调上一部注册的 SmsSession.Event<br>Event里的信息有: TelephonySettings, TelephonyServiceState, ImsConnectionsState, RilDataCall[], errorCode 是我们要关心的, 开关机检测主要关心ImsConnectionState.<br>ImsConnectionState 中有状态 STATE_UNKONWN, CONNECTED, PROGRESSING, RESUMED, SUSPENDED.<br>结合以上的at指令终端交互流程可知, ImsConnectionState, errorCode, 即为短信发送后可获取的具体状态. </p>
<p>接下来, 继续确定, framework层抛出的短信broadcast 是否依ImsConnectionState 状态决定的. </p>
<p>注册调用链:</p>
<p>com.android.internal.telephony.SMSDispatcher.java::sendText(.., deliveryIntent, mSenderCallback) -&gt;<br>    com.android.internal.telephony.SMSDispatcher.MultiparSmsSender::onServiceReady() -&gt;<br>        android.service.carrier.ICarrierMessagingService.aidl::sendMultipartTextSms(…,deliveryIntent, mSenderCallback) -&gt;<br>        com.android.internal.telephony.SMSDispatcher.SmsSenderCallback::onSendSmsComplete() -&gt;<br>            com.android.internal.telephony.CommandsInterface,<br>            在CommandsInterface::setOnSmsStatus 回调中, 调用注册deliveryIntent, 向上层应用发送消息状态. </p>
<p>调用 mSenderCallback的流程:</p>
<p>SMSDispatcher 即为一个Handler, 处理短信发送相关的几个状态为:<br>    EVENT_SEND_SMS_COMPLETE, EVENT_SEND_RETRY, EVENT_SEND_CONFIRMED_SMS, EVENT_STOP_SENDING, EVENT_HANDLE_STATUS_REPORT,<br>    EVENT_SEND_LIMIT_REACHED_CONFIRMATION, EVENT_CONFIRM_SEND_TO_POSSIBLE_PREMIUM_SHORT_CODE<br>初始化SMSDISPATCHER的类为<br>com.android.internal.telephony.IccSmsInerfaceManager,<br>初始化的实类为 ImsSmsDispatcher, 在其handleMessage中 处理的消息为 EVENT_IMS_STATE_DONE, EVENT_IMS_STATE_CHANGED<br>触发这个消息的的类为<br>在CommandsInterface::registerForImsNetworkStateChanged(this, EVENT_IMS_STATE_CHANGED, null);<br>CommandsInterface 的实例 mCi 为 com.android.internal.telephony.Phone.java 中的单例<br>Phone的实例为 GsmCdmaPhone.java , 通过 TelephonyComponentFactory::makeIccSmsInterfaceManager(this) 传入<br>GsmCdmaPhone::initOnce() 中通过 TelephonyComponentFactory::makeGsmCdmaCallTracker() 初始化<br>在Phone系的构造函数中会构造TelephoneComponentFactory.makeAppSmsManager 初始化 AppSmsmanager 监听短信状态.<br>在IccSmsInterfaceManager 构造函数中初始化 ImsSMSDispatcher 会传递 phone.smsUsageMonitor, 初始化InBoundSmsHandler, SmsBroadcastUndelivered<br>在InboundSmsHandler::dispatchSmsDeliveryIntent 中会调用 mAppSmsManager.handleSmsReceiverdIntent<br>InboundSmsHandler::processMessage 调用 dispatchSmsDeliveryIntent, 在初始化 StartupState 中由消息 EVENT_BROADECAST_SMS 处理短信发送状态. </p>
<p>由InboundSmsHandler.StartupState 中的注释可知, 最终通知回调的类为SmsBroadcastUndevlivered, 其中亦有 EVENT_BROADECAST_SMS 消息事件处理, 逻辑为开一个线程轮询查询RawTable, 通过 ContentProvider 查询 PDU_PENDING_MESSAGE_PROJECTION, 通过 Telephony.Sms.CONTENT_URI (“content://sms/sent”)找到 SMS Provider 查询rawpdudata </p>
<p>那么表里的信息是何时写的呢? 在 InboundSmsHandler::writeInboxMessage 由 InboundSmsHandler::dispatchSmsDeliveryIntent 由SmsManager::getAutoPersisting()为true时触发</p>
<p>继续跟踪 InboundSmsHandler::dispatchSmsDeliveryIntent 的触发时机<br>由 android.telephony.CarrierMessagingServiceConnection.CarrierMessagingServiceConnection::onServiceConnected -&gt;<br>    android.telephony.CarrierMessagingServiceConnection::onServiceReady(在android.internal.telephony.CarrierServiceSmsFilter中实现) -&gt;<br>    android.internal.telephony.CarrierServiceSmsFilter::filterSms -&gt;<br>    InboundSmsHandler.CarrierServiceSmsFilterCallback::onFilterComplete -&gt;<br>    InboundSmsHandler::dispatchSmsDeliveryIntent</p>
<p>接下来 分析 CarrierMessagingServiceConnection 中的 ICarrierMessagingService::filterSms() 逻辑,<br>ICarrierMessagingService 由 CarrierMessagingSerivce 中的 ICarrierMessagingWrapper 作为service 端来实现具体业务</p>
<p>结合短信发送流程: 接收端收到一条短信, 会向SMS center 发送一条是否成功的报文, SMS center 再将这些信息返回给发送者(可参考附录10), 这时发送端相当于接收了一条pdu, android 作为接收端就是遍历这些pdu, 通过filterSms 来达确认是否成功送达或是一条新短信. </p>
<p>CarrierMessagingSerivce 编历的pdu, 是怎么获取的? 这里仍旧没有探索到. </p>
<p>分析至此, 已可知当前的短信开关机检测是与at命令的效果一致的. </p>
<p>因此当前的开关机检测可视为准确的. </p>
<p>PS: 时间有限, 关于此次分析相关的UML图, 流程图就先不画了, 直接采用文字描述. 有纰漏之处或者疑问, 欢迎指出, 进行进一步计论.  </p>
<h3 id="查看radio-日志"><a href="#查看radio-日志" class="headerlink" title="查看radio 日志"></a>查看radio 日志</h3><p>修改 system/core/liblog/logger_write.c 中 __android_log_buf_write() 方法, 将RIL, IMS, AT log都打开, 合并到radio buffer 中</p>
<p>adb logcat -b radio 查看 radio buffer 中的日志信息.  </p>
<p>查看pdu, 在deliveringIntent 中的 pdu 中存储的. 只有联通给联通电信发, 电信给电信发, 移动给移动发才有. </p>
<p>附录:</p>
<ol>
<li><a href="lifewire.com/what-is-sms-mms-iphone-2000247">Everything You Need to Know About SMS &amp; MMS on the iPhone</a></li>
<li><a href="en.wikipedia.org/wiki/SMS">SMS wiki</a></li>
<li><a href="developershome.com/sms/atCommandsIntro.asp">Introduction to AT Commands</a></li>
<li><a href="wikipedia.org/Hayes_command_set">Hayes command set</a></li>
<li><a href="developershome.com/sms">SMS Tutorial</a></li>
<li><a href="https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/at-cmgd/" target="_blank" rel="noopener">gsm-modem-tutorial</a></li>
<li><a href="https://www.smssolutions.net/tutorials/gsm/sendsmsat/" target="_blank" rel="noopener">Send SMS using AT commands</a></li>
<li><a href="https://www.engineersgarage.com/tutorials/at-commands-gsm-at-command-set/" target="_blank" rel="noopener">gsm-at-commands-set</a></li>
<li><a href="http://www.gsm-modem.de/sms-pdu-mode.html" target="_blank" rel="noopener">sms-pdu-mode</a></li>
<li><a href="http://www.developershome.com/sms/sms_tutorial.asp?page=basicConcepts#5.4" target="_blank" rel="noopener">Message Delivery Reports</a></li>
</ol>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Android/" rel="tag"># Android</a>
              <a href="/tags/%E7%9F%AD%E4%BF%A1%E4%B8%8E%E7%94%B5%E8%AF%9D/" rel="tag"># 短信与电话</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2019/11/28/thought/thinking_about_write/" rel="prev" title="如何提升写作">
      <i class="fa fa-chevron-left"></i> 如何提升写作
    </a></div>
      <div class="post-nav-item">
    <a href="/2019/11/29/linux/working_with_gentoo/" rel="next" title="gentoo使用记录">
      gentoo使用记录 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#android-短信与电话模块分析"><span class="nav-number">1.</span> <span class="nav-text">android 短信与电话模块分析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#at指令"><span class="nav-number">1.1.</span> <span class="nav-text">at指令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#源码分析"><span class="nav-number">1.2.</span> <span class="nav-text">源码分析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#查看radio-日志"><span class="nav-number">1.3.</span> <span class="nav-text">查看radio 日志</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Sophimp"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">Sophimp</p>
  <div class="site-description" itemprop="description">A dream begin</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">86</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
        <span class="site-state-item-count">89</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/sophimp" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sophimp" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:sophimp2020@126.com" title="E-Mail → mailto:sophimp2020@126.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Sophimp</span>
</div>

<!--
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>
-->

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
